<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title></title>
  </head>
  <body>
    <select id="province" onchange="province(this.value)"></select>省
    <select id="city"></select>市
  </body>

  <script>
      //初始化
      let arr = new Array();
      arr["湖南省"] = new Array("长沙", "湘潭", "株洲", "衡阳");
      arr["湖北省"] = new Array("武汉", "武昌", "青州");
      arr["江西省"] = new Array("武昌");
      for (let provinceName in arr) {
          document.getElementById("province").innerHTML += "<option value='" + provinceName + "'>" + provinceName + "</option>";
      }
      province("湖南省")

      function province(value) {
          let city = arr[value];
          document.getElementById("city").innerHTML = '';
          for (let cityName in city) {//数字下标
              document.getElementById("city").innerHTML += "<option value='" + cityName + "'>" + city[cityName] + "</option>";
          }
      }
  </script>
</html>
